//index.js
//获取应用实例
const a = getApp()

Page({
    data: {

      dataInfo: {},
      userList: {},
      
    },
    onLoad: function () {
      var o = this;
      o.getDate();
      o.getUserList();
    },
    getDate: function () {
      var o = this;
      a.util.request({
        url: "entry/wxapp/yqhy",
        cachetime: "0",
        data: {
          openid: getApp().getOpenId,
        },
        header: {
          "content-type": "application/json"
        },
        dataType: "json",
        success: function (t) {
          console.log(t);
          o.setData({
            dataInfo: t.data
          })
        }
      });
    },
    getUserList: function (type = 'lb') {
      var o = this;
      o.setData({
        'type': type
      });
      a.util.request({
        url: "entry/wxapp/yqlb",
        cachetime: "0",
        data: {
          type: type,
        },
        header: {
          "content-type": "application/json"
        },
        dataType: "json",
        success: function (t) {
          o.setData({
            userList: t.data
          });
        }
      });
    },
    // 选择时间
    ShowPricker: function () {
        this.setData({
            isShowPricker: true,
        })
    },
    bindChange: function (e) {
        let val = e.detail.value;
    },
    ClosePricker: function () {
        this.setData({
            isShowPricker: false,
        })
    },
    bandLuck: function () {
      this.getUserList('lb');
    },
    bandMorning: function () {
      this.getUserList('money');
    },
    bandWill: function () {
      this.getUserList('mx');
    },
    ConfirmPricker: function () {
        this.setData({
            isShowPricker: false,
        });
    },
})